package jianzhi

func numWays(n int) int {
	var mod int = 1e9 + 7

	if n == 1 || n == 0 {
		return 1
	} else if n == 2 {
		return 2
	}

	p, q, res := 1, 2, 0

	for i := 3; i <= n; i++ {
		res = (p + q) % mod
		p = q
		q = res
	}

	return res
}
